package cn.tedu.icop.basic.controller;

import cn.tedu.icop.api.domain.GunStatusUpdateParam;
import cn.tedu.icop.api.model.RestResult;
import cn.tedu.icop.api.model.RestResultUtils;
import cn.tedu.icop.basic.service.GunService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/basic")
public class GunController {
    private GunService gunService;
    public GunController(GunService gunService) {
        this.gunService = gunService;
    }
    @ApiOperation("更新枪状态")
    @PutMapping("/gun/status/edit")
    public RestResult editGunStatus(@RequestBody GunStatusUpdateParam param) {
        log.debug("更新枪状态:{}",param);
        Boolean success = gunService.editGunStatus(param);
        RestResult ok = RestResultUtils.success(success);
        log.debug("更新枪状态:{},出参:{}",param,ok);
        return ok;
    }
}
